package com.mini.repository;

import com.mini.model.BusinessChanceWechat;
import com.mini.model.BusinessChanceWechatRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author shixiaopeng  on 2020/12/2
 */
@Repository
public interface BusinessChanceWechatRecordRepository extends JpaRepository<BusinessChanceWechatRecord, Long>, JpaSpecificationExecutor<BusinessChanceWechatRecord> {


    @Query(value = "select * from business_chance_wechat_record where wechat_no = ?1 and to_days(create_time) = to_days(now());", nativeQuery = true)
    BusinessChanceWechatRecord findTodayByWechatNo(String wechatNo);
}
